package com.wanxi.step07test.controller;

import com.wanxi.step07test.dto.ResultDTO;
import com.wanxi.step07test.model.Role;
import com.wanxi.step07test.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@CrossOrigin
@RestController
public class RoleController {
 @Autowired
 private RoleService roleService;


//    @PreAuthorize("hasAuthority('role:findAll')")
    @RequestMapping("/back/role/findAll")
    public ResultDTO findAll(Role role) {
        ResultDTO resultDTO = roleService.findAll(role);
        return resultDTO;
    }
}
